import { call, put, takeEvery} from 'redux-saga/effects'
import { fetchJobListAPI } from './apis.js'
import { PUT_JOB_LIST } from './actions.js'


export function* fetchJobList(action) {
  const result = yield fetchJobListAPI()
  console.log('result:', result)
  yield put({ type: PUT_JOB_LIST, result })
}

export function* rootSaga() {
  yield takeEvery('FETCH_JOB_LIST', fetchJobList)
}


